<!-- include tpl=head_lay -->
<script type="text/javascript">
function save()
{
	var tip = $.dialog.tips('正在导入，请稍候…',1000).lock()
	$("#post_save").ajaxSubmit({
		'url':get_plugin_url('phpexcel','import_end'),
		'type':'post',
		'dataType':'json',
		'success':function(rs){
			tip.close();
			if(rs.status){
				$.dialog.alert(rs.info,true,'succeed');
				return true;
			}
			$.dialog.alert(rs.info,false,'error');
			return false;
		}
	});
	return false;
}
</script>
<form method="post" class="layui-form" id="post_save" onsubmit="return save()">
<input type="hidden" name="file" id="file" value="{$file}" />
<input type="hidden" name="pid" id="pid" value="{$pid}" />

<div class="layui-card">
	<div class="layui-card-header">
		匹配字段信息，所有导入均不导入第一行，第一行为标识行
		<div class="fr">
			<a href="{url ctrl=plugin func=exec _phpokid=$rs.id pid=$pid exec=in_data/}" class="layui-btn layui-btn-sm">重新选择</a>
		</div>
	</div>
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">
				文件
			</label>
			<div class="layui-input-block">
				<input type="text" disabled value="{$res.title}{if $res.ext}.{$res.ext}{/if}，上传时间：{func date 'Y-m-d H:i:s' $res.addtime}" class="layui-input" style='border:0;' />
			</div>
		</div>
		<!-- if $catelist -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				目标分类
			</label>
			<div class="layui-input-block">
				<select id="cate_id" name="cate_id">
					<option value="0">不选择</option>
					<!-- loop from=$catelist key=$key value=$value -->
					<option value="{$value.id}">{$value.space}{$value.title}</option>
					<!-- /loop -->
				</select>
			</div>
		</div>
		<!-- /if -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				审核状态
			</label>
			<div class="layui-input-block">
				<input type="radio" name="status" id="status_0" value="0" checked title="未审核" />
				<input type="radio" name="status" id="status_1" value="1" title="已审核" />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				是否隐藏
			</label>
			<div class="layui-input-block">
				<input type="radio" name="hidden" id="hidden_0" value="0" checked title="显示" />
				<input type="radio" name="hidden" id="hidden_1" value="1" title="隐藏" />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				唯一性
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" name="is_only" id="is_only" value="0" checked title="忽略" />
			</div>
			<div class="layui-form-mid">
				导入的数字需要检测唯一时，请直接选择相应的字段
			</div>
		</div>
	</div>
</div>
<div class="layui-row layui-col-space10">
	<!-- loop from=$idlist key=$key value=$value id=$tmpid -->
	<div class="layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3">
		<div class="layui-card">
			<div class="layui-card-header">
				{$value} &raquo; {$key}1
				<div class="fr">
					<input type="radio" name="is_only" value="{$key}1" title="唯一" />
				</div>
			</div>
			<div class="layui-card-body">
				<select name="link[{$key}1]" id="link_{$key}1">
				<option value="">请选择，留空忽略…</option>
				<!-- loop from=$flist key=$k value=$v -->
				<option value="{$k}"{if $v == $value} selected{/if}>{$v}</option>
				<!-- /loop -->
				</select>
			</div>
		</div>
	</div>
	<!-- /loop -->
</div>
<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang开始导入}" class="layui-btn layui-btn-danger" id="save_button" />
		<span style="padding-left:2em;color:#ccc;">当您点击“开始导入”时，请耐心等候……</span>
	</div>
</div>

</form>

<!-- include tpl=foot_lay -->